package com.rapid.getway.consumer;

//消费者

import com.common.rabitmq.RabbitmqName;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 *  发布订阅模式
 */
@Component
public class TopicConsumer {

    @RabbitListener(queues = {RabbitmqName.rapid_gateway})
    public void queueRead(Message message, Channel channel){
        System.out.println(RabbitmqName.rapid_gateway+" 收到来自通道："+channel+"消息："+new  String(message.getBody()));
    }

}
